//
//  DSSHPhotoMainVC.m
//  DSSH
//
//  Created by lcy on 16/3/28.
//  Copyright © 2016年 lcy. All rights reserved.
//

#import "DSSHPhotoMainVC.h"
#import "DSSHLoginViewController.h"
#import "DSSHCommunityVC.h"
#import "DSSHSearchDVC.h"
#define TABLEWIDTH ([UIScreen mainScreen].bounds.size.width - 20)


@interface DSSHPhotoMainVC () <UITableViewDelegate,UITableViewDataSource>
{
}

@end

@implementation DSSHPhotoMainVC

- (void)viewDidLoad {
    
    [super viewDidLoad];
    for (int i = 0 ; i < 3; i ++ ) {
        NSMutableArray *tmpnarray = [NSMutableArray array];
        for (int k =0; k < (i+1) *5; k++) {
            [tmpnarray addObject:[NSString stringWithFormat:@"%d",k]];
        }
        [self.dataoftable addObject:tmpnarray];
    }
    UIStoryboard *board = [UIStoryboard storyboardWithName: @"DSSHLogin" bundle: nil];
    DSSHLoginViewController * vc = [board instantiateViewControllerWithIdentifier: @"DSSHLogin"];
    [self.navigationController pushViewController:vc animated:YES];
//    self.tableView0.frame = CGRectMake(0, 2, TABLEWIDTH, 44 * self.dataoftable.count);
    
}
-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *str = nil;
    
    if(tableView == self.tableView0){
        
        
         str   = self.dataoftable[0][indexPath.row];
        
        
    }
    if(tableView == self.tableView1){
        
        str   = self.dataoftable[1][indexPath.row];
    }
    if(tableView == self.tableView2){
        
        
        str   = self.dataoftable[2][indexPath.row];    }

    DSSHCommunityVC *comVc = [[DSSHCommunityVC alloc] init ];
    
    comVc.recodeStr = str;
    
    [self.navigationController pushViewController:comVc animated:YES];
    
    
}
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    DSSHLog(@"开始编辑");
    DSSHSearchDVC *search = [[DSSHSearchDVC alloc ]init];
    search.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:search animated:YES];
    return NO;
}

@end

